package com.liang.subject.infra.es.config;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.elasticsearch.index.query.BoolQueryBuilder;
import org.elasticsearch.search.fetch.subphase.highlight.HighlightBuilder;
import org.elasticsearch.search.sort.SortOrder;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class EsSearchRequest {
    private BoolQueryBuilder bq; // 查询条件

    private String[] fields; // 搜索的字段

    private int from; // 页码

    private int size; // 每页大小

    private Boolean needScroll; // 快照

    private Long minutes; // 快照的缓存时间

    private String sortName; // 排序字段

    private SortOrder sortOrder; // 排序方式

    private HighlightBuilder highlightBuilder; // 高亮显示
}
